﻿/* $RCSFile: PluginStepAttribute.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/CRMWrapper3/Plugins/PluginStepAttribute.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:33  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

using CrmSdk;
using AddonNice.CRMWrapper.CRM4Server;

namespace AddonNice.CRMWrapper.Plugins
{
    public enum PluginStepInvocationSource
    {
        ParentPipeline = 0,
        ChildPipeline = 1,
    }
    public enum PluginStepMode
    {
        Synchronous = 0,
        Asynchronous = 1,
    }

    public enum PluginStepStage
    {
        PreEvent = 10,
        PostEvent = 50,
    }

    public enum PluginStepSupportedDeployment
    {
        ServerOnly=0,
        OutlookClientOnly=1,
        Both=2
    }

    [AttributeUsage(AttributeTargets.Class, AllowMultiple=true)]
    public class PluginStepAttribute: Attribute
    {
        public PluginStepAttribute(string message, PluginStepStage stage)
        {
            this.Message = message;
            this.Stage = stage;
        }

        public PluginStepStage Stage { get; private set; }
        public string Message { get; private set; }

        public string PrimaryEntityName { get; set; }
        public string SecondaryEntityName { get; set; }

        public PluginStepMode Mode { get; set; }
        public int Rank { get; set; }
        public string Description { get; set; }
        public string FilteringAttributes { get; set; }
        public PluginStepInvocationSource InvocationSource { get; set; }
        public PluginStepSupportedDeployment SupportedDeployment { get; set; }

        public string StepId { get; set; }
    }
}
